﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CMS6Tools.Common.Email
{
    #region ITextTemplateExtraData
    public interface ITextTemplateExtraData
    {
        void Add(string key, string value, bool replaceExisted = true);
        void AddDictionary(int key, IDictionary<string, string> dictionary, bool replaceExisted = true);
        string GetValue(string key);
        string GetTableDataValue(int rowIndex, string columnName);
    }
    #endregion

    #region EmptyTextTemplateExtraData
    public class EmptyTextTemplateExtraData : ITextTemplateExtraData
    {
        public static readonly EmptyTextTemplateExtraData Default = new EmptyTextTemplateExtraData();

        public string GetValue(string key)
        {
            return string.Empty;
        }

        public string GetTableDataValue(int rowIndex, string columnName)
        {
            return string.Empty;
        }

        public void Add(string key, string value, bool replaceExisted = true)
        {
        }

        public void AddDictionary(int key, IDictionary<string, string> dictionary, bool replaceExisted = true)
        {
        }
    }
    #endregion
}
